<?php
session_start();
if(! isset($_SESSION['id'])) {
    header('Location:index.html');
}
?>
<?php
if($_SESSION['id']!=='92'){
header('Location:index.html');
}
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>请假信息</title>
    <link href="css/bootstrap.min.css" type="text/css" rel="stylesheet">
    <script src="js/jquery.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <style>
        .div{
            position: relative;
            text-align: center;
            padding-left: 500px;
        }
        .font{
            font-size: 16px;
            font-weight: bold;;
        }
        form{
            font-weight:bold;
        }
    body {
	background-color: #F2F2F2;
}
    .2 {
	color: #FFF;
}
 .send {
  width: 60px;
  outline: none;
  border: none;
  background: rgb(0, 132, 255);
  height: 15px;
  cursor: pointer;
  color: #fff;
  border-radius: 20px;
  font: bold 14px '宋体';
  transition: all 0.5s;
  margin-top: 30px;
margin  auto 0;
  
}
    </style>
<script src="js/jquery.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="./js/main2.js"></script>
   

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div style="text-align: center; font-family: 'Comic Sans MS', cursive;">
<div align="center">
  <?php
include ("guanl.php");
?>
</div>
 
<form action='ht.php' method='post'>
<table class="table table-bordered table-hover">

  <tr>
<div class="send"onClick="set()">全选</div>
   <div class="send" onClick="sett()">取消</div>
        <th bgcolor="#7A8BB6"><div align="center">选择</div></th>
        <th bgcolor="#7A8BB6"><div align="center">序号</div></th>
        <th bgcolor="#7A8BB6">游戏名</th>
        <th bgcolor="#7A8BB6"><div align="center">请假日期</div></th>
        <th bgcolor="#7A8BB6"><div align="center">天数</div></th>
        <th bgcolor="#7A8BB6"><div align="center">结束日期</div></th>
<th bgcolor="#7A8BB6"><div align="center">操作</div></th>
    </tr>


    <?php
    //    1. 链接数据库
    header("content-type:text/html;charset=utf8");
include('conn.php');

    //2.执行sql  //3.data 解析
    $sql_select = "select * from stu where flag=0 and shen='已通过'";
   
    foreach ( $conn->query($sql_select) as $row) {
        echo "<tr>";
       echo "<th><input type='checkbox' name='sel[]' value='".$row["id"]."'/>"."</th>";
        echo "<th>{$row['id']} </th>";
        echo "<th>{$row['nicheng']}</th>";
        echo "<th>{$row['qing']} </th>";
        echo "<th>{$row['ts']} </th>";
        echo "<th>{$row['jie']}</th>";
        echo"<td>
<a href='edit.php?id={$row['id']}'>修改</a>
</td>";
        echo "</tr>";
    }
echo "<input type='submit' name='btnDel' value='删除' onclick='return confirm(\"确定要删除选中的信息吗？\");'/>";
echo "<input type='submit' name='btnDels' value='彻底删除' onclick='return confirm(\"确定要彻底删除选中的信息吗？\");'/>";
    ?>
</table>
</form>
</div>
<script>
function set(){

$("input").prop("checked",true);

}
function sett(){

$("input").prop("checked",false);

}
        </script>
</body>
</html>